<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<%
	Integer adminloginid=(Integer)session.getAttribute("adminloginid");
	String adminloginname=(String)session.getAttribute("adminloginname");
	String adminloginpix=(String)session.getAttribute("adminloginpix");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" href="${pageContext.request.contextPath}/bootstrap/img/favicon.ico"> <!-- 这是页面的标题图标，可更换自己需要的icon-->
<link href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css?v=3.3.5" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/animate.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrap/css/style.min.css?v=4.0.0" rel="stylesheet">
<link href="${pageContext.request.contextPath}/bootstrapStyle/css/plugins/toastr/toastr.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/bootstrap/css/jquery-confirm.css"/>
<title>管理界面主页</title>
</head>
<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
	<div id="wrapper">
        <!--左侧导航开始-->
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="nav-close"><i class="fa fa-times-circle"></i>
            </div>
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element">
                            <a data-toggle="dropdown" class="dropdown-toggle" href="">
                            	<span><img alt="image" class="img-rounded m-t-xs img-responsive" src="<%=adminloginpix %>" style="width: 100px"/></span>
                                <span class="clear">
	                               	<span class="block m-t-xs">
	                               		<strong class="font-bold">
	                               			<%-- ${sessionScope.get('adminloginname')} --%>
	                               			<%=adminloginname %>
	                               		</strong>
	                              	</span>
                                </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <%-- <li><a class="J_menuItem" href="form_avatar.html">修改头像</a></li>
                                <li><a class="J_menuItem" href="${pageContext.request.contextPath }/Main/myinfo/MyInformation.action">个人资料</a></li>
                                <li><a class="J_menuItem" href="${pageContext.request.contextPath }/Main/changePas.action">修改密码</a></li> --%>
                                <li><a href="#" onclick="LoginOut()">安全退出</a></li>
                            </ul>
                        </div>
                    </li>
                    <li>
                        <a href="#">
                            <i class="fa fa-user-md"></i>
                            <span class="nav-label">医生端管理</span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Doctor/doctorlist.action">医生端信息管理</a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Doctor/doctorexamine.action">医生端信息审核</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
                            <i class="fa fa-child"></i>
                            <span class="nav-label">病人端管理</span>
                            <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                                <a class="J_menuItem" href="${pageContext.request.contextPath }/Main/Patient/patientlist.action">病人端信息管理</a>
                            </li>
                            <li>
                                <a class="J_menuItem" href="${pageContext.request.contextPath }/Main/Patient/patientexamine.action">病人端信息审核</a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href="#">
	                        <i class="fa fa-hospital-o"></i>
	                        <span class="nav-label">医院端管理</span>
	                        <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Hospital/hospitallist.action">医院端信息管理</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Hospital/hospitalexamine.action">医院端信息审核</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
	                        <i class="fa fa-hospital-o"></i>
	                        <span class="nav-label">部门管理</span>
	                        <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/HospDeptMan/hospdeptexamine.action">医院部门审核</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
	                        <i class="fa fa-hospital-o"></i>
	                        <span class="nav-label">打款管理</span>
	                        <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Paymoney/payforDoc.action">医生打款</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Paymoney/payforHosp.action">医院打款</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/Paymoney/payforPatient.action">病人退款</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
	                        <i class="fa fa-hospital-o"></i>
	                        <span class="nav-label">退款管理</span>
	                        <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/DrawBack/drawbacklist.action">订单退款</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
	                        <i class="fa fa-edit"></i>
							<span class="nav-label">系统管理</span>
							<span class="fa arrow"></span>
						</a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/SetRate/setrateshow.action">系统利率设置</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="#">系统分析</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="${pageContext.request.contextPath}/Main/FeedBackMan/FeedBackInfo.aciton">反馈信息管理</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#">
	                        <i class="fa fa-user"></i>
	                        <span class="nav-label">我的信息</span>
	                        <span class="fa arrow"></span>
                        </a>
                        <ul class="nav nav-second-level">
                            <li>
                            	<a class="J_menuItem" href="#">管理员基本信息</a>
                            </li>
                            <li>
                            	<a class="J_menuItem" href="#">管理员操作日志</a>
                            </li>
                        </ul>
                    </li>
                    <%-- <c:forEach items="${list}" var="Flistvar">
                    	<c:if test="${Flistvar.menufatherid==0 }">
                    		<li>
		                        <a href="#">
			                        <i class="fa fa-user-md"></i>
			                        <span class="nav-label">${Flistvar.menuname}</span>
			                        <span class="fa arrow"></span>
		                        </a>
		                        <ul class="nav nav-second-level">
		                        	<c:forEach items="${list}" var="Slistvar">
		                        		<c:if test="${Slistvar.menufatherid==Flistvar.menuid}">
				                            <li>
				                            	<a class="J_menuItem" href="${Slistvar.menuurl}">${Slistvar.menuname}</a>
				                            </li>
		                        		</c:if>
		                        	</c:forEach>
		                        </ul>
		                    </li>
                    	</c:if>
                    </c:forEach> --%>
                </ul>
            </div>
        </nav>
        <!--左侧导航结束-->
        
        <!--右侧部分开始-->
        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0">
                    <div class="navbar-header"><a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i>收起菜单</a></div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li class="dropdown">
                            <a class="J_menuItem dropdown-toggle count-info" data-toggle="dropdown" onclick="" href="#">
                               	 消息管理<i class="fa fa-envelope"></i> <span class="label label-info" id="messagetotal"></span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
            <div class="row content-tabs">
                <button class="roll-nav roll-left J_tabLeft"><i class="fa fa-backward"></i>
                </button>
                <nav class="page-tabs J_menuTabs">
                    <div class="page-tabs-content">
                        <a href="javascript:;" class="active J_menuTab" href="${pageContext.request.contextPath }/Main/index.action">首页</a>
                    </div>
                </nav>
                <a href="#" onclick="LoginOut()" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 退出</a>
            </div>
            <div class="row J_mainContent" id="content-main">
                <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${pageContext.request.contextPath }/Main/index.action" frameborder="0" seamless>
	            	
                </iframe>
            </div>
        </div>
        <!--右侧部分结束-->
    </div>
    <script src="${pageContext.request.contextPath}/bootstrap/js/jquery.min.js?v=2.1.4"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/bootstrap.min.js?v=3.3.5"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/plugins/layer/layer.min.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/hplus.min.js?v=4.0.0"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/contabs.min.js"></script>
    <script src="${pageContext.request.contextPath}/bootstrap/js/plugins/pace/pace.min.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrapStyle/js/plugins/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath }/js/websocket.js"></script>
    <script src="${pageContext.request.contextPath }/bootstrap/js/jquery-confirm.js"></script> 
    <script type="text/javascript">  
    function ToaStrShow(title,msg){
		toastr.options = {
                closeButton: true, //显示关闭按钮
                debug: false, //启用debug
                progressBar:true,//是否显示进度条
                positionClass: "toast-bottom-right",//弹出的位置
                showDuration: "300",//显示的时间
                hideDuration: "5000",//消失的时间
                timeOut: "50000", //停留的时间
                extendedTimeOut: "50000",//控制时间
                showEasing: "swing",//显示时的动画缓冲方式
                hideEasing: "linear",//消失时的动画缓冲方式
                showMethod: "fadeIn",//显示时的动画方式
                hideMethod: "fadeOut", //消失时的动画方式
                onclick:function(){
                	$.alert(msg);
                }
        };
		toastr.info(msg,title);
		/* if(type==1){
			toastr.info(msg,title);
		}else if(type==2){
			toastr.success(msg,title);
		}else if(type==3){
			toastr.warning(msg,title);
		}else if(type==4){
			toastr.error(msg,title);
		} */
	}
    var websocket = null;  
    if ('WebSocket' in window) {  
        //Websocket的连接  
        websocket = new WebSocket("ws://118.89.172.204:6221/internetmedical/websocket/socketServer/admin_<%=adminloginid%>");//WebSocket对应的地址  
    }  
    else if ('MozWebSocket' in window) {  
        //Websocket的连接  
        websocket = new MozWebSocket("ws://118.89.172.204:6221/internetmedical/websocket/socketServer/admin_<%=adminloginid%>");//SockJS对应的地址  
    }  
    else {  
        //SockJS的连接  
        websocket = new SockJS("http://118.89.172.204:6221/internetmedical/sockjs/socketServer/admin_<%=adminloginid%>");    //SockJS对应的地址  
    }  
    websocket.onopen = onOpen;  
    websocket.onmessage = onMessage;  
    websocket.onerror = onError;  
    websocket.onclose = onClose;  
  
    function onOpen(openEvt) {  
        //alert(openEvt.Data);  
    }  
  
    
    function onMessage(evt) {  
        //alert(evt.data);  
        ToaStrShow("新消息提醒",evt.data);
        var mestotal = $("#messagetotal").text();
        if(mestotal==""){
        	mestotal=0;
        }
        var total = parseInt(mestotal);
    	var newtotal = total+1;
    	$("#messagetotal").text(newtotal);
    }  
    function onError() {  
    }  
    function onClose() {  
    }
    
    window.close = function () {  
        websocket.onclose();  
    }  
    
    function LoginOut(){
    	$.confirm({
		    title: '提示!',
		    content: '你确定要退出？',
		    type: 'red',
		    typeAnimated: true,
		    buttons: {
		    	确定: function () {
		    		window.location.href="${pageContext.request.contextPath}/Login/logoutsubmit";
		    	},
				取消: function () {},
		    }	
		});
    }
</script> 
</body>
</html>